#ifndef ONEPERSON_H
#define ONEPERSON_H

#include <QWidget>
#include <QComboBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "qcustomplot.h"
#include "accountitem.h"


extern QVector<double> in_factData, balanceData, overfulData;
extern QVector<struct Users> g_friends;
extern int g_index;
class onePerson : public QWidget
{
    Q_OBJECT
public:
    explicit onePerson(QWidget *parent = 0);
    QCustomPlot *diagram;
    QCustomPlot *customPlot;
    QString demoName;
    QHBoxLayout *top_lay;
    QVBoxLayout *main_lay;
    QComboBox *friends;
    QWidget *container;
    QListWidget* m_Accountlist; //下拉列表;
    QCPBars *overful;
    QCPBars *balance;
    QCPBars *in_fact;
    QVector<double> ticks;
private:
    void initFriendsBox();
signals:
    void sigFriendChange();
public slots:
    void onShowAccountInfo(int index, QString accountName);// 将当前选择的登录用户信息显示界面;
    void onRemoveAccount(int index);    // 移除当前登录列表中某一项;
    void setupBarChart();
    void dataUpdate();
};

#endif // ONEPERSON_H
